<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layout/layout-adminlte}">
<head>
    <title>类目列表</title>
</head>
<body>
<ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-compact nav-child-indent" data-widget="treeview" role="menu" data-accordion="false"
    th:include="fragments/common-adminlte::menu(${'/admin/category/list'})" layout:fragment="menu"></ul>
<div layout:fragment="content" xmlns:th="http://www.w3.org/1999/html">
    <table class="table table-bordered table-striped">
        <thead>
        <tr>
            <th class="text-center">ID</th>
            <th>名称</th>
            <th>操作 <a href="#" th:href="@{'/admin/category/edit/{catId}'(catId=0)}">新建</a></th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="category:${categories}">
            <td class="text-center" th:utext="${category.catId}">ID</td>
            <td class="text-center" ><a href="#" target="_blank"  th:href="@{'/blogPost/category/{catName}/'(catName=${category.title})}" th:utext="${category.title}">title</a></td>
            <td><a href="#"  th:href="@{'/admin/category/edit/{catId}'(catId=${category.catId})}" >编辑</a> </td>
        </tr>
        </tbody>
    </table>
    <div class="row">
        <div class="col-lg-6 d-none d-md-inline">
            <div th:text="|展现${pageIndex}页 ,共计${totalPages}页,合计${total}条|"></div>
        </div>
        <div class="col-sm-12 col-xs-12 text-right">
            <ul class="pagination" th:replace="fragments/common-adminlte::pager(${pageIndex},${totalPages},'/admin/category/list/{page}')"/>
        </div>
    </div>
</div>
</body>
</html>